﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="msBsc.WebUi.wfOfficeNewsFinder"
    CodeBehind="wfOfficeNewsFinder.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head  runat="server">
    <title>车辆信息审核</title>
    <link href="/jqPlugin/jqTab/ui.tabs.css" rel="stylesheet" type="text/css" />

    <script src="/jqPlugin/jqTab/ui.tabs.js" type="text/javascript"></script>

    <link href="/jqPlugin/kindeditor/themes/default/default.css" type="text/css" rel="stylesheet" />
    <script src='/??jqPlugin/kindeditor/kindeditor.js,jqPlugin/kindeditor/lang/zh_CN.js'
        type='text/javascript'></script>
    <style type="text/css">
        html, body {
            overflow: hidden;
            margin-left: 0px;
            margin-top: 0px;
            margin-right: 0px;
            margin-bottom: 0px;
        }
    </style>
    <script src="/jqPlugin/js/jBase.js"></script>
    <script src="/jqPlugin/js/jBPage.js"></script>
    <script src="/jqPlugin/js/laytpl.js"></script>
    <script type="text/javascript">
        K = KindEditor;
        //        K.DEBUG = true;
        K.basePath = K.options.basePath = '/jqPlugin/kindeditor/';
        K.options.themesPath = K.options.basePath + 'themes/';
        K.options.langPath = K.options.basePath + 'lang/';
        K.options.pluginsPath = K.options.basePath + 'plugins/';

        var jlueditor7 = function () {
            var editor = new Sigma.Editor();
            var input = Sigma.$e('input', { type: 'text', value: editor.defaultValue || '', className: 'gt-editor-text', style: { width: '78px', styleFloat: 'left' } });
            var button = Sigma.$e('input', { type: 'button', value: editor.defaultValue || '', className: 'gt-editor-date', styleFloat: 'left' });
            editor.dom.style.overflow = 'hidden';
            editor.dom.appendChild(input);
            editor.dom.appendChild(button);

            editor.setSize = function (w, h) {
                this.width = w || this.width;
                this.height = h || this.height;
                if (this.width / 1 && this.width > 0) {
                    this.dom.style.width = (this.width - 1) + 'px';
                }
                if (this.height / 1 && this.height > 0) {
                    this.dom.style.height = (this.height - 1) + 'px';
                }
                this.dom.firstChild.style.width = (this.width - 20) + 'px';
            };


            var fillDate = function (imgurl, editorfile) {
                $(input).val(imgurl);
                editor.onClose && editor.onClose();
                editorfile.hideDialog();
            };

            var showCalendar = function () {
                var editorfile = K.editor({
                    allowFileManager: true
                });
                editorfile.fileManagerJson = '/pgajax.axd?F_MANA=1&rType1=0&rType2=0&COOKATHID=' + (typeof (cookesc) == "undefined" ? "" : cookesc)
                                    + "&fType=" + "image";
                editorfile.loadPlugin('filemanager', function () {
                    editorfile.plugin.filemanagerDialog({
                        viewType: 'VIEW',
                        dirName: 'image',
                        clickFn: function (url, title) {
                            fillDate(url, editorfile);
                        }
                    });
                });

            };
            Sigma.U.addEvent(button, 'click', showCalendar);

            editor.valueDom = input;
            return editor;
        };




        var clopCheckBox = { "True": "是", "False": "否" };
        function clrdCheckBox(value, record, columnObj, grid, colNo, rowNo) {
            var options = clopCheckBox;
            var ret = options[value];
            if (ret == null) {
                ret = value;
            }
            return ret;
        };

        var clopValid_NO = { "1": "等待审核", "2": "审核通过", "3": "审核不通过" };
        function clrdValid_NO(value, record, columnObj, grid, colNo, rowNo) {
            var options = clopValid_NO;
            var ret = options[value];
            if (ret == null) {
                ret = value;
            }
            return ret;
        };

        //要自定义显示，比如链接等字段如下buynow,在renderer函数中返回要显示的HTML编码字符
        var colsOption = [
            { id: 'chk', isCheckColumn: true, filterable: false, exportable: false },
            { id: 'OFFICIAL_NEWS_ID', hidden: true, filterable: false, exportable: false },
            { id: 'OFFICIAL_NEWS_TITLE', header: "公告标题", width: 130, editor: { type: 'text' } },
            { id: 'OFFICIAL_NEWS_CONTENT', header: "公告内容", width: 260, editor: { type: 'text' } },
            { id: 'NEWS_PUBLISH_TIME', header: "生效时间", width: 160, editor: { type: 'date' } },
            { id: 'NEWS_EXPIRA_TIME', header: "截止时间", width: 160, editor: { type: 'date' } },
            { id: 'NEWS_PUBLISH_BY', header: "发布者", width: 130 },
            { id: 'NEWS_IS_DELETED', header: "是否删除", width: 100, editor: { type: "select", options: clopCheckBox, defaultText: 'False' }, renderer: clrdCheckBox },
        ];

        //以下为固定的代码
        var gridOption1 = getGtOp('myGrid1', colsOption, 'gridbox1', 'BANK_ID');
        var mygrid1 = new Sigma.Grid(gridOption1);
        //////////////////////////////////////////////////////////
        function btnDo(sEbtn) {
            GtGrid1Action = sEbtn;
            var opart = GetGtParam("myGrid1");
            if (sEbtn == "mFinder") {
                doFinderGt('myGrid1');
            }
            else if (sEbtn == "btnEdit") {
                opart.AddCell("sEditMode", "EDIT");
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            else if (sEbtn == "btnSave") {
                doSaveGt('myGrid1');
            }
            else if (sEbtn == "btnConfirm" || sEbtn == "btnCancel") {
                var sidtem1 = GetGtSelectId('myGrid1');
                if (sidtem1) {
                    opart.AddCell("CHECK_ID", sidtem1);
                    ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
                } else {
                    alert("请先选择记录！");
                }
            }
            else {
                ajaxComm(opart, null, null, 'divCondition'); //调用页面回调，并传入参数
            }
            GtGrid1Action = "";
        };
        function GetGtParam(jqGridID) {
            var _jsParam = new jsonRow();
            if (jqGridID == "myGrid1") {
                GetFormJson("divCondition", _jsParam);
                _jsParam.AddCell("PPAGE", "wfConstantHandle"); //这个地方是该页面的类名
                _jsParam.AddCell("gtGridID", "myGrid1");
                _jsParam.AddCell("sRadom", $("#sRadom").val());
                _jsParam.AddCell("txtStatus", $("#txtStatus").val());
                _jsParam.AddCell("ACTION", GtGrid1Action);
                //这里可增加传入后台的参数
            } return _jsParam;
        };
        $(window).load(function () {
            $('#txtINITIAL_DT_S').date_input('%Y-%m-%d');
            $('#txtINITIAL_DT_E').date_input('%Y-%m-%d');
            //初始化步进式搜索框
            $('#container2').fadeIn("fast"); //初始化TAB页选择控件
            $('#container2 ul').tabs();
            mygrid1.render();
            mygrid1.readOnly = true;
            autogtResize("bigbox2", mygrid1);
            SetBtnEnable('btnEdit', 'btnSave,btnNotSave,btnConfirm,btnCancel');
        });
        function doTabChange(sStatus) {
            if (sStatus != $('#txtStatus').val()) {
                $('#txtStatus').val(sStatus); btnDo('mFinder');
            }
        };

    </script>

</head>
<body>
    <form id="wfConstantHandle" method="post" runat="server">
        <asp:HiddenField ID="txtStatus" runat="server" Value="0" />
        <div style="width: 100%; text-align: left; margin: 0px 0px 0px 0px;">
            <div id="container2" style="width: 100%; margin-top: 3px; display: none;">
                <ul>
                    <li><a href="#fragment1" onclick="javascript:doTabChange('1');return false;"><span>生效中</span></a> </li>
                    <li><a href="#fragment1" onclick="javascript:doTabChange('2');return false;"><span>未到生效日期</span></a> </li>
                    <li><a href="#fragment1" onclick="javascript:doTabChange('3');return false;"><span>已过截止日期</span></a> </li>
                    <li><a href="#fragment1" onclick="javascript:doTabChange('4');return false;"><span>已删除</span></a> </li>
                    <li><a href="#fragment1" onclick="javascript:doTabChange('5');return false;"><span>所 有</span></a> </li>
                </ul>
                <div id="fragment1">
                    <div id="divCondition" style="margin: 0px; border-style: solid; border-width: 1px; border-color: #C8D2E0;">
                        <table border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td class="label" width="70px">搜索名称
                                </td>
                                <td align="right" width="110px">
                                    <asp:TextBox ID="txtBANK_NME" runat="server" Width="110px" MaxLength="100"></asp:TextBox>
                                </td>
                                <td align="center">
                                    <input type="button" onclick="javascript: btnDo('mFinder'); return false;" value="查询(F)"
                                        id="btnFinder" accesskey="F" />
                                    <input type="button" onclick="javascript: btnDo('btnEdit'); return false;" value="编辑(E)"
                                        id="btnEdit" accesskey="E" />
                                    <input type="button" onclick="javascript: btnDo('btnSave'); return false;" value="保存(S)"
                                        id="btnSave" accesskey="S" />
                                    <input type="button" onclick="javascript: btnDo('btnNotSave'); return false;" value="取消(Z)"
                                        id="btnNotSave" accesskey="Z" /><%--<asp:TextBox ID="txtINITIAL_DT_S" runat="server" Width="110px"></asp:TextBox>--%>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="bigbox2" style="margin: 0px; margin-top: 2px;">
                        <div id="gridbox1" style="border: 0px solid #cccccc; background-color: #f3f3f3; padding: 5px;">
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</body>
</html>

